/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package BLL;

import DAL.DALUser;
import DTO.DTOUser;
import java.util.ArrayList;

/**
 *
 * @author Pham
 */
public class BLLUser {
    DALUser dalUser;
    
    public BLLUser()
    {
        dalUser = new DALUser();
    }
    
    //method check login
    public DTOUser checkLogin(String username, String password)
    {
        return dalUser.checkLogin(username, password);
    }
    
    //method change password
    public boolean changePassword(String username, String oldPass, String newPass)
    {
        return dalUser.changePassword(username, oldPass, newPass);
    }
    
    //method get all user
    public ArrayList<DTOUser> getAllUser()
    {
        return dalUser.getAllUser();
    }
    
    //method create user
    public boolean createUser(DTOUser dtoUser)
    {
        return dalUser.createNewUser(dtoUser);
    }
    
    //method update user
    public boolean updateUser(DTOUser dtoUser)
    {
        return dalUser.updateUser(dtoUser);
    }
    
    //method get user by id
    public DTOUser getUserById(int id)
    {
        return dalUser.getUserbyId(id);
    }
    
    //method delete user
    public boolean deleteUser(int id)
    {
        return dalUser.deleteUser(id);
    }
}
